package BaseObject;

import java.util.Comparator;

public class ComparatorProba implements Comparator<Object>{

	@Override
	public int compare(Object o1, Object o2) {
		if(o1 instanceof Itinerary && o2 instanceof Itinerary)
		{
			
			Itinerary it1 = (Itinerary) o1;
			Itinerary it2 = (Itinerary) o2;
			if(it1.probability < it2.probability )
				return 1;
			else if(it1.probability == it2.probability )
				return 0;
			else
				return -1;
		}
		return 0;
	}

}
